<template>
    <div id='tmpl'>
        <h4 v-text="desc.title"></h4>
        <p class="line"></p>
        <p v-html="desc.content"></p>
    </div>
</template>
<script>
export default {
    data() {
        return {
            id: 0,     //代表的是当前商品的ID
            desc: {}
        }
    },
    created() {
        this.id = this.$route.params.id;
        this.getgoodsdesc();
    },
    methods: {
        getgoodsdesc: function () {
            var url = this.$common.apidomain + '/api/goods/getdesc/' + this.id;
            this.$http.get(url).then(function (response) {
                var data = response.body;
                if (data.status !== 0) {
                    this.$tip(data.message);
                }
                this.desc = data.message[0];
            })
        }
    }
}
</script>
<style scoped>
#tmpl {
    padding: 5px;
}

#tmpl h4 {
    color: #0094ff;
}

#tmpl .line {
    height: 1px;
    border: 1px solid rgba(0, 0, 0, 0.3);
}
</style>